<?xml version="1.0" encoding="UTF-8"?>

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:t="http://myfaces.apache.org/tomahawk">
    
    <ui:composition template="/pages/user/templates/userAdminTemplate.xhtml">
        <ui:define name="pageTitle">
            <h:outputText value="Edit User Roles"/>
        </ui:define>

        <ui:define name="centerPane">
            <h:form id="mainForm">
            
                <rich:pickList id="rolesPickList" value="#{editUserRolesAction.chosenRoles}">
                    <!-- For some reason, selectItems tag is not working here.  Picklist does not
                         pick up the value bound to selectItems which then invalidates the user's
                         selected items. 
                    <f:selectItems value="#{editUserRolesAction.allRoles}" />-->
                    
                    <f:selectItem itemValue="1" itemLabel="ROLE_ADMIN"/>
                    <f:selectItem itemValue="2" itemLabel="ROLE_USER"/>
                    
                </rich:pickList>
                
                <h:commandButton value="Save" action="#{editUserRolesAction.save}"/>
                <h:commandButton value="Cancel" action="gotoEditUser"/>
                
                <t:inputHidden value="#{editUserRolesAction.userId}" forceId="true" id="userId"/>
            </h:form>
        </ui:define>
    </ui:composition>
    
</html>